import { getNormalList } from '@/api/home/homeApi'
import { HomeModel } from '@/api/home/homeModel'
import { ref, computed } from 'vue'

export default function userHomeRequest() {
  const normalList = ref([])
  const getNormalListApi = async (params: HomeModel) => {
    let response = await getNormalList(params)
    normalList.value = response.data
  }

  const checkCount = computed(() => {
    return normalList.value.filter(item => {
      return item['check'] == true
    }).length
  })
  return {
    getNormalListApi,
    normalList,
    checkCount
  }
}
